//
//  SafWordCell.m
//  SafPay
//
//  Created by 贺庆博 on 2018/6/19.
//  Copyright © 2018年 ebo. All rights reserved.
//

#import "SafWordCell.h"

@implementation SafWordCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.safeWordBtn.layer.cornerRadius = 3;
    // Initialization code
}
- (void)setModel:(SafeWordModel *)model
{
    _model = model;
    self.safeWordBtn.userInteractionEnabled = self.canEdit;
    if (!_canEdit) {
        self.safeWordBtn.backgroundColor = rgb(33,177,227);
    }else
    {
        self.safeWordBtn.backgroundColor =model.isSelected?rgb(182,182,182):rgb(33,177,227);
    }
    [self.safeWordBtn setTitle:model.word forState:UIControlStateNormal];
    
}

- (IBAction)btnClick:(id)sender {
    if (self.wordBtnBlock) {
        self.wordBtnBlock(self.safeWordBtn, self.idx);
    }
}

@end
